{% extends "../main.html" %}
{% block nem %}
<ul class="nav nav-sidebar">
    <li><a href="/users">用户管理</a></li>
    <li><a href="/users/add">添加用户</a></li>
    <li class="active"><a href="/users/edit">更新</a></li>

</ul>

{% end %}
{% block bodyy %}
<h3 class="sub-header" content="">更新用户</h3>

    <div class="panel-body">
        <form class="form-horizontal" method="post">
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">ID号</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="id" value={{data[0][0]}} readOnly="true">
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" name="name" value="{{data[0][1]}}">
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">密码</label>
                <div class="col-sm-10">
                    <input type="password" class="form-control" id="inputPassword3" placeholder="密码" name="passwd"
                           value="{{data[0][2]}}">
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">邮箱</label>
                <div class="col-sm-10">
                    <input type="email" class="form-control" id="inputEmail3" placeholder="邮箱" name="email"
                           value="{{data[0][3]}}">
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">账号状态</label>
                <div class="col-sm-10">
                    <select id="sel_menu" class="form-control" name="status">
                        {% if data[0][4] %}
                        <option value="1" selected>启用</option>
                        <option value="0">禁用</option>
                        {% else %}
                        <option value="0" selected>禁用</option>
                        <option value="1">启用</option>
                        {% end %}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">联系电话</label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="inputEmail3" placeholder="电话号码" name="phone"
                           value="{{data[0][5]}}">
                </div>
            </div>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">权限等级</label>
                <div class="col-sm-10">
                    <select id="sel_menu" class="form-control" name="qx">
                        {% for i in data2 %}
                        {%if data[0][6]==i[0]%}
                        <option value="{{i[0]}}" selected>{{i[1]}}</option>
                        {%else%}
                        <option value="{{i[0]}}">{{i[1]}}</option>
                        {%end%}
                        {% end %}
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button type="submit" class="btn btn-primary" name="cmd" value="update">更新</button>
                    <button type="submit" class="btn btn-danger" name="cmd" value="false">取消</button>
                </div>
            </div>
        </form>
    </div>
{% end %}
